package org.deng.learn.designpattern.state;

/**
 * @author DengLibin
 * @Description 在线状态
 * @Date 2019/3/14 0014 16:10
 */
public class OnlineState implements ClientState {
    private MsgClient msgClient;

    public  OnlineState(MsgClient msgClient){
        this.msgClient = msgClient;
    }
    @Override
    public void showChatForm() {
        System.out.println("聊天窗口弹出来了");
    }

    @Override
    public void sendMsg(String msg, String receiver) {
        System.out.println(String.format("[%s]发送消息[%s]给[%s]", msgClient.getUsername(), msg, receiver));
    }
}
